package com.lyj.service.impl;

import com.lyj.mapper.AdminMapper;
import com.lyj.pojo.Admin;
import com.lyj.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
    AdminMapper adminMapper;

    @Override
    public Admin adminLogin(String username, String password, String duty) {
        Admin admin = adminMapper.adminLogin(username, password, duty);
        return admin;
    }

    @Override
    public List<Admin> queryAdminAll() {
        List<Admin> admins = adminMapper.queryAdminAll();
        return admins;
    }

    @Override
    public Boolean addAdmin(Admin admin) {
        Boolean aBoolean = adminMapper.addAdmin(admin);
        return aBoolean;
    }
    //删除管理员
    @Override
    public Boolean delAdminById(int adminId) {
        Boolean aBoolean = adminMapper.delAdminById(adminId);
        return aBoolean;
    }

    @Override
    public Boolean updateAdminById(Admin admin) {
        Boolean aBoolean = adminMapper.updateAdminById(admin);
        return aBoolean;
    }

    @Override
    public Admin queryAdminById(int adminId) {

        Admin admin = adminMapper.queryAdminById(adminId);
        return admin;
    }


}
